<?php

namespace App\Models\Issue;

class OptionRepository
{
    public function store(IssueOption $option)
    {
        $option->saveOrFail();
        return $option;
    }

    public function getOneById($id)
    {
        return IssueOption::where('id', $id)->first();
    }

    public function getByIssue($issueId)
    {
        return IssueOption::where('issue_id', $issueId)->get();
    }

    public function deleteByIssue($issueId)
    {
        return IssueOption::where('issue_id', $issueId)->delete();
    }
}
